rolesystem.core
Interface RoleSystem


public interface RoleSystem

This interface allows to act within the role system, without being registered.


Method Summary
 RoleRegistration reqRegistration(java.lang.String role)
          Asks to system to be registered, requesting a specified role to be assigned.
 int[] searchForRole(java.lang.String role)
          Asks to server to search for all registrations a specified role is assigned to.
 int[] searchForRole(java.lang.String role, long timeout)
          Asks to server to search for all registrations a specified role is assigned to.
 int[] searchForRoleNoWait(java.lang.String role)
          Asks to server to search for all registrations a specified role is assigned to.
 

Method Detail

reqRegistration

RoleRegistration reqRegistration(java.lang.String role)
                                 throws RoleException
Asks to system to be registered, requesting a specified role to be assigned.

Parameters:
role - Role to assign to registration.
Returns:
The instance that allows to act within the role system, being registered.
Throws:
RoleException

searchForRole

int[] searchForRole(java.lang.String role)
                    throws RoleException
Asks to server to search for all registrations a specified role is assigned to. This method returns as soon as at least one suitable registration is found.

Parameters:
role - Role that must be assigned to registrations.
Returns:
An array filled with the identifiers of found registrations.
Throws:
RoleException

searchForRole

int[] searchForRole(java.lang.String role,
                    long timeout)
                    throws RoleException
Asks to server to search for all registrations a specified role is assigned to. This method returns as soon as at least one suitable registration is found or the specified timeout expires.

Parameters:
role - Role that must be assigned to registrations.
timeout - The maximum time to wait, in milliseconds; if it is 0, this method behaves like the one without timeout.
Returns:
An array filled with the identifiers of found registrations; if no suitable registration is found, the array has length equal to 0.
Throws:
RoleException

searchForRoleNoWait

int[] searchForRoleNoWait(java.lang.String role)
                          throws RoleException
Asks to server to search for all registrations a specified role is assigned to. This method returns immediately.

Parameters:
role - Role that must be assigned to registrations.
Returns:
An array filled with the identifiers of found registrations; if no suitable registration is found, the array has length equal to 0.
Throws:
RoleException